Change in openvpn[master]: Change dev null to be a driver type instead of a special mode of tun/tap
A message that is not in the archive (sent off-list or not yet received): gerrit.1726491830000.I5987ebb7c38ab176eed7efc004ea54f606a77a12@...2715...
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
to review the following change.
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
---
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
4 files changed, 78 insertions(+), 111 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/748/1
src/openvpn/init.c +10 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +61 -109
254 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -54,6 +54,7 @@* this is always defined. We error out if a user tries to open this type * on unsupported platforms*/ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO , #ifdef HAVE_NET_IF_UTUN_HDRIVER_UTUN
@@ -790,4 +791,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
to look at the new patch set (#3).
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
---
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
4 files changed, 86 insertions(+), 113 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/748/3
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {tun_afunix_close (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -54,6 +54,7 @@* this is always defined. We error out if a user tries to open this type * on unsupported platforms*/ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO , #ifdef HAVE_NET_IF_UTUN_HDRIVER_UTUN
@@ -790,4 +791,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 4: Code-Review-1
(1 comment)
Patchset:
PS4:
Breaks Tests on FBSD14
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Tue, 17 Sep 2024 09:52:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 4:
(1 comment)
File src/openvpn/tun.c:
http://gerrit.openvpn.net/c/openvpn/+/748/comment/dad2299f_312af0e5 :
PS4, Line 1750: if (tt->backend_driver != DRIVER_AFUNIX && tt->backend_driver != DRIVER_NULL)
Wrong patch
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Tue, 17 Sep 2024 11:59:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 6:
(1 comment)
File src/openvpn/tun.c:
http://gerrit.openvpn.net/c/openvpn/+/748/comment/2cd24244_93fea8be :
PS4, Line 1750: if (tt->backend_driver != DRIVER_AFUNIX && tt->backend_driver != DRIVER_NULL)
Quoted 1 line
Wrong patch
Done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 6
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Wed, 18 Sep 2024 11:54:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Code-Review-1 by flichtenheld
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
---
M src/openvpn/dco.c
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
5 files changed, 93 insertions(+), 113 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/748/7
src/openvpn/dco.c +7 -0
@@ -306,6 +306,13 @@return false; } + if(is_dev_type(o->dev, o->dev_type, "null") + { +msg (msglevel,"Note: null tun type selected, disabling data channel" +"offload" ); +return false; + } +if (o->connection_list) {const struct connection_list *l = o->connection_list;
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {tun_afunix_close (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -51,6 +51,7 @@* This is always defined. We error out if a user tries to open this type * of backend on unsupported platforms. */ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO ,/** macOS internal tun driver */ DRIVER_UTUN
@@ -788,4 +789,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 7
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
to look at the new patch set (#8).
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
---
M src/openvpn/dco.c
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
5 files changed, 93 insertions(+), 113 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/748/8
src/openvpn/dco.c +7 -0
@@ -306,6 +306,13 @@return false; } +if (is_dev_type (o->dev, o->dev_type,"null" )) + { +msg (msglevel,"Note: null tun type selected, disabling data channel" +"offload" ); +return false; + } +if (o->connection_list) {const struct connection_list *l = o->connection_list;
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {tun_afunix_close (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -51,6 +51,7 @@* This is always defined. We error out if a user tries to open this type * of backend on unsupported platforms. */ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO ,/** macOS internal tun driver */ DRIVER_UTUN
@@ -788,4 +789,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 8
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 8:
(1 comment)
File src/openvpn/tun.c:
http://gerrit.openvpn.net/c/openvpn/+/748/comment/c01a0b89_02af6ff2 :
PS6, Line 475: * really matter as it will discard evertything anyway */
"everything"
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 8
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Wed, 18 Sep 2024 16:13:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: plaisthos.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
to look at the new patch set (#9).
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
---
M src/openvpn/dco.c
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
5 files changed, 93 insertions(+), 113 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/748/9
src/openvpn/dco.c +7 -0
@@ -306,6 +306,13 @@return false; } +if (is_dev_type (o->dev, o->dev_type,"null" )) + { +msg (msglevel,"Note: null tun type selected, disabling data channel" +"offload" ); +return false; + } +if (o->connection_list) {const struct connection_list *l = o->connection_list;
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {tun_afunix_close (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -51,6 +51,7 @@* This is always defined. We error out if a user tries to open this type * of backend on unsupported platforms. */ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO ,/** macOS internal tun driver */ DRIVER_UTUN
@@ -788,4 +789,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 9
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 8:
(1 comment)
File src/openvpn/tun.c:
http://gerrit.openvpn.net/c/openvpn/+/748/comment/1cd8b369_731cd17e :
PS6, Line 475: * really matter as it will discard evertything anyway */
Quoted 1 line
"everything"
Done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 8
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Wed, 18 Sep 2024 17:35:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 9: Code-Review-1
(2 comments)
Patchset:
PS9:
close :-)
File src/openvpn/dco.c:
http://gerrit.openvpn.net/c/openvpn/+/748/comment/ba0f33a0_74f63ab7 :
PS9, Line 312: "offload");
the wrapping has lost the space ("data channeloffload") and I wouldn't actuall break the string here... this is more ugly than a 87 character long line (and I think our styleguide permits this)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 9
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 19 Sep 2024 07:03:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 10:
(1 comment)
File src/openvpn/dco.c:
http://gerrit.openvpn.net/c/openvpn/+/748/comment/7fcffed5_5e97825a :
PS9, Line 312: "offload");
Quoted 1 line
the wrapping has lost the space ("data channeloffload") and I wouldn't actuall break the string here […]
Acknowledged
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 10
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 20 Sep 2024 12:02:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld.
Hello cron2, flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
to look at the new patch set (#11).
The following approvals got outdated and were removed:
Code-Review-1 by cron2
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
---
M src/openvpn/dco.c
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
5 files changed, 93 insertions(+), 113 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/748/11
src/openvpn/dco.c +7 -0
@@ -306,6 +306,13 @@return false; } +if (is_dev_type (o->dev, o->dev_type,"null" )) + { +msg (msglevel,"Note: null tun type selected, disabling data channel " +"offload" ); +return false; + } +if (o->connection_list) {const struct connection_list *l = o->connection_list;
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {close_tun_afunix (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -51,6 +51,7 @@* This is always defined. We error out if a user tries to open this type * of backend on unsupported platforms. */ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO ,/** macOS internal tun driver */ DRIVER_UTUN
@@ -784,4 +785,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 11
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Patch Set 11: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 11
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 24 Sep 2024 12:43:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v11 1/1 Change dev null to be a driver type instead of a special mode of tun/tap
In reply to a message not in the archiveFrom: Arne Schwabe <[email protected]...>
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/748
This mail reflects revision 11 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/dco.c +7 -0
@@ -306,6 +306,13 @@return false; } +if (is_dev_type (o->dev, o->dev_type,"null" )) + { +msg (msglevel,"Note: null tun type selected, disabling data channel " +"offload" ); +return false; + } +if (o->connection_list) {const struct connection_list *l = o->connection_list;
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {close_tun_afunix (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -51,6 +51,7 @@* This is always defined. We error out if a user tries to open this type * of backend on unsupported platforms. */ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO ,/** macOS internal tun driver */ DRIVER_UTUN
@@ -784,4 +785,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
[Openvpn-devel] [PATCH applied] Re: Change dev null to be a driver type instead of a special mode of tun/tap
This is just basic refactoring, making future work on special-case hacks like "--dev null" or "af_unix" more streamlined. No functional change expected or seen.
The change to tun.c looks huge but is mostly re-indenting after getting rid of the DEV_TYPE_NULL condition (-> git show -w) in open_tun_generic(), and also moving the check from all the open_tun() to open_tun_backend().
As with the previous patch, unwrapped the "offload".
Your patch has been applied to the master branch.
commit 8fe14fea935d6c2591649353eb7daf4977585b03
Author: Arne Schwabe Date: Tue Sep 24 14:43:28 2024 +0200
Change dev null to be a driver type instead of a special mode of tun/tap
Signed-off-by: Arne Schwabe <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29384.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#12) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29384.html
---
M src/openvpn/dco.c
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
5 files changed, 92 insertions(+), 113 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/748/12
src/openvpn/dco.c +6 -0
@@ -305,6 +305,12 @@return false; } +if (is_dev_type (o->dev, o->dev_type,"null" )) + { +msg (msglevel,"Note: null tun type selected, disabling data channel offload" ); +return false; + } +if (o->connection_list) {const struct connection_list *l = o->connection_list;
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {close_tun_afunix (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -51,6 +51,7 @@* This is always defined. We error out if a user tries to open this type * of backend on unsupported platforms. */ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO ,/** macOS internal tun driver */ DRIVER_UTUN
@@ -784,4 +785,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 12
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/748?usp=email )
Change subject: Change dev null to be a driver type instead of a special mode of tun/tap
......................................................................
Change dev null to be a driver type instead of a special mode of tun/tap
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29384.html
---
M src/openvpn/dco.c
M src/openvpn/init.c
M src/openvpn/proto.h
M src/openvpn/tun.c
M src/openvpn/tun.h
5 files changed, 92 insertions(+), 113 deletions(-)
src/openvpn/dco.c +6 -0
@@ -305,6 +305,12 @@return false; } +if (is_dev_type (o->dev, o->dev_type,"null" )) + { +msg (msglevel,"Note: null tun type selected, disabling data channel offload" ); +return false; + } +if (o->connection_list) {const struct connection_list *l = o->connection_list;
src/openvpn/init.c +15 -1
@@ -1764,6 +1764,10 @@/* Using AF_UNIX trumps using DCO */ c->c1.tuntap->backend_driver =DRIVER_AFUNIX ; } +else if (is_dev_type (c->options.dev, c->options.dev_type,"null" )) + { + c->c1.tuntap->backend_driver =DRIVER_NULL ; + }#ifdef _WIN32 else {
@@ -1858,7 +1862,12 @@ open_tun_backend(struct context *c) {struct tuntap *tt = c->c1.tuntap; -if (tt->backend_driver ==DRIVER_AFUNIX ) + +if (tt->backend_driver ==DRIVER_NULL ) + { +open_tun_null (c->c1.tuntap); + } +else if (tt->backend_driver ==DRIVER_AFUNIX ) {open_tun_afunix (&c->options, c->c2.frame.tun_mtu, tt, c->c2.es); }
@@ -2059,6 +2068,11 @@ {close_tun_afunix (c->c1.tuntap); } + else if (c->c1.tuntap->backend_driver == DRIVER_NULL) + { +free (c->c1.tuntap->actual_name); +free (c->c1.tuntap); + } else {close_tun (c->c1.tuntap, &c->net_ctx);
src/openvpn/proto.h +0 -1
@@ -33,7 +33,6 @@* Tunnel types */ #define DEV_TYPE_UNDEF 0 -#define DEV_TYPE_NULL 1#define DEV_TYPE_TUN 2/* point-to-point IP tunnel */ #define DEV_TYPE_TAP 3/* ethernet (802.3) tunnel */
src/openvpn/tun.c +64 -111
271 lines not on this page · raw message
src/openvpn/tun.h +7 -0
@@ -51,6 +51,7 @@* This is always defined. We error out if a user tries to open this type * of backend on unsupported platforms. */ DRIVER_AFUNIX , +DRIVER_NULL ,DRIVER_DCO ,/** macOS internal tun driver */ DRIVER_UTUN
@@ -784,4 +785,10 @@ {return tt && tt->type !=DEV_TYPE_UNDEF ; } + +static inline void +open_tun_null (struct tuntap *tt) +{ + tt->actual_name =string_alloc ("null" ,NULL ); +}#endif /* TUN_H */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/748?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5987ebb7c38ab176eed7efc004ea54f606a77a12
Gerrit-Change-Number: 748
Gerrit-PatchSet: 12
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged